package test.jvm;

import java.util.ArrayList;
import java.util.List;

/**
 * 所有对象的实例分配都在Java堆上分配内存，堆大小由-Xmx和-Xms来调节
 *
 */
public class HeapOOM {
	
	static class OOMObject{}

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		List<OOMObject> list = new ArrayList<OOMObject>();
		
		while(true){
			list.add(new OOMObject());
		}
	}

}